<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>canvas</title>
    <script>
    window.onload = function(argument) {
        draw();

        function draw(argument) {
            var canvas = document.getElementById('canvas');
            var context = canvas.getContext('2d');
            context.beginPath();
            context.moveTo(100, 100);
            context.lineTo(200, 200);
            context.lineTo(100, 200);
            context.clip();
            context.beginPath();
             /*for (var i = 0; i < 300; i+=10) {
                 context.moveTo(0,i);
                 context.lineTo(500,i);
             }*/
            context.moveTo(0, 20);
            context.lineTo(500, 20);
              context.moveTo(0, 50);
            context.lineTo(500, 50);
            context.stroke();
        };
    }
    </script>
</head>

<body>
    <canvas id="canvas" width="800" height="800"></canvas>
</body>

</html>
